#include <iostream>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
using namespace std;

void handler(int signo)
{
    cout << "收到了" << signo << "号信号" << endl;
}

int main()
{
    signal(9, handler); 
    while(true)
    {
        cout << "I am running..., pid :" << getpid() << endl;
        sleep(1);
    }
    return 0;
}
